﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

/// <summary>
/// 全ての生物は意識を継承します．
/// </summary>
class senses
{
    protected List<doTop> codeLists
        = new List<doTop>();
    protected List<doTop> outQuery
        = new List<doTop>();
    protected List<Neuron> network
        = new List<Neuron>();

    protected senses() //Block to constructor
    {
    }

    public doTop Next()
    {
        doTop dowork;
        do
        {
            if (codeLists.Count == 0)
            {
                return null;
            }
            dowork = codeLists[0];
            codeLists.RemoveAt(0);
            outQuery.Add(dowork);

        } while (dowork == new None());

        return dowork;

    }

    public int getNetworkCount()
    {
        return network.Count;
    }

    public void addList(doTop doNext)
    {
        codeLists.Add(doNext);
    }

    public void addList(doTop[] doNext)
    {
        codeLists.AddRange(doNext);
    }

    public void delList(doTop doNext)
    {
        while (codeLists.IndexOf(doNext) != -1)
        {
            codeLists.Remove(doNext);
        }
    }

    public doTop[] getLists()
    {
        return outQuery.ToArray();
    }
    public doTop[] getListsToDo()
    {
        return codeLists.ToArray();
    }
}